/*
 * Created on May 22, 2005
 *
 */
package org.mushroomdb.engine.impl;

import org.mushroomdb.engine.ResultSet;
import org.mushroomdb.exception.EvaluationEngineException;


/**
 * @author Matias
 *
 */
public class ObjectArrayResultSet implements ResultSet {
	private Object[] objects;
	private int index;

	/**
	 * @param relationOperation
	 */
	public ObjectArrayResultSet(Object[] objects) {
		this.objects = objects;
		this.index = 0;
	}

	/**
	 * @see org.mushroomdb.engine.ResultSet#hasNext()
	 */
	public boolean hasNext() throws EvaluationEngineException {
		return this.index < this.objects.length;
	}

	/**
	 * @see org.mushroomdb.engine.ResultSet#next()
	 */
	public Object next() throws EvaluationEngineException {
		Object object = this.objects[this.index];
		this.index ++;
		return object;
	}

	/**
	 * @see org.mushroomdb.engine.ResultSet#close()
	 */
	public void close() {
	}

}
